package com.cskaoyan.controller;

import com.cskaoyan.bean.PageInfo;
import com.cskaoyan.bean.User;
import com.cskaoyan.bean.UserPageInfo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author stone
 * @date 2022/03/24 15:03
 */
@RestController
@RequestMapping("user")
public class UserController {

    //http://localhost:8080/user/login?username=songge&birthday=2022/03/24
    @RequestMapping("login")
    public String login(String username, Date birthday) {
        return "login success";
    }

    //http://localhost:8080/user/login2?username=songge&birthday=2022/03/24
    @RequestMapping("login2")
    public String login2(User user) {
        return "login success";
    }

    //localhost:8080/user/list?page=1&limit=10&username=songge
    //综合封装的案例
    @RequestMapping("list")
    public String list(PageInfo info,String username) {
        return "success";
    }

    //localhost:8080/user/list2?page=1&limit=10&username=songge&birthday=2022/03/24
    @RequestMapping("list2")
    public String list2(PageInfo info,User user) {
        return "success";
    }

    //localhost:8080/user/list3?page=1&limit=10&username=songge&birthday=2022/03/24
    @RequestMapping("list3")
    public String list3(UserPageInfo userPageInfo) {
        return "success";
    }


}
